package com.booby.algorithm.utils;

/**
 * 功能描述: 工具类
 *
 * @author: lizt
 * @date: 2020/7/31 11:36
 **/

public class Utils {

    public static void swap(Integer[] arr, int currentIndex, int targetIndex ){
        int temp = arr[currentIndex];
        arr[currentIndex] = arr[targetIndex];
        arr[targetIndex] = temp;
    }

    public static void print(Integer[] arr){
        for (Integer i : arr){
            System.out.print(i + "  ");
        }
        System.out.println();
    }

    public static void print(Integer[] array1, Integer[] array2){
        for (int i = 0; i < DataCheckUtil.ARRAY_LENGH; i++) {
            if (!array1[i].equals(array2[i])){
                System.out.println("排序失败");
                break;
            }
        }
        System.out.println("本次校验成功");
    }
}
